<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交网站活动推荐</title>
    
    <!-- 引入所需的CDN文件 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <style>
        :root {
            --primary: #2563eb;
            --primary-light: #dbeafe;
            --secondary: #64748b;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --light: #f8fafc;
            --dark: #1e293b;
            --shadow: 0 4px 12px rgba(0,0,0,0.08);
            --transition: all 0.3s ease;
        }
        
        body {
            background-color: #f1f5f9;
            color: var(--dark);
        }
        
        .event-card {
            transition: var(--transition);
            border-radius: 12px;
            overflow: hidden;
            background-color: white;
            border: none;
            box-shadow: var(--shadow);
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        
        .event-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.12);
        }
        
        .event-image-container {
            position: relative;
            overflow: hidden;
        }
        
        .event-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }
        
        .event-card:hover .event-image {
            transform: scale(1.05);
        }
        
        .event-tag {
            position: absolute;
            top: 12px;
            left: 12px;
            font-size: 0.8rem;
            padding: 3px 10px;
            border-radius: 20px;
            background-color: var(--primary);
            color: white;
            font-weight: 500;
            z-index: 2;
        }
        
        .event-status {
            position: absolute;
            top: 12px;
            right: 12px;
            font-size: 0.8rem;
            padding: 3px 10px;
            border-radius: 20px;
            z-index: 2;
        }
        
        .status-hot {
            background-color: var(--danger);
            color: white;
        }
        
        .status-new {
            background-color: var(--success);
            color: white;
        }
        
        .status-soon {
            background-color: var(--warning);
            color: white;
        }
        
        .multi-image-grid {
            display: grid;
            gap: 4px;
            height: 100%;
        }
        
        .multi-image-2 {
            grid-template-columns: 1fr 1fr;
        }
        
        .multi-image-3 {
            grid-template-columns: 1fr 1fr;
        }
        
        .multi-image-3 img:last-child {
            grid-column: span 2;
        }
        
        .multi-image-4 {
            grid-template-columns: 1fr 1fr;
        }
        
        .event-info {
            padding: 1.25rem;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .event-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--dark);
            transition: var(--transition);
        }
        
        .event-card:hover .event-title {
            color: var(--primary);
        }
        
        .event-meta {
            display: flex;
            align-items: center;
            color: var(--secondary);
            font-size: 0.85rem;
            margin-bottom: 0.75rem;
            gap: 1rem;
        }
        
        .event-meta i {
            margin-right: 4px;
        }
        
        .event-description {
            color: var(--secondary);
            font-size: 0.9rem;
            line-height: 1.5;
            margin-bottom: 1rem;
            flex: 1;
        }
        
        .event-organizer {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 1rem;
        }
        
        .organizer-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .organizer-name {
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .event-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: auto;
        }
        
        .participants {
            display: flex;
            align-items: center;
            font-size: 0.85rem;
            color: var(--secondary);
        }
        
        .participant-avatars {
            display: flex;
        }
        
        .participant-avatars img {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 2px solid white;
            margin-left: -8px;
        }
        
        .participant-avatars img:first-child {
            margin-left: 0;
        }
        
        .join-btn {
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            padding: 6px 16px;
            font-size: 0.9rem;
            font-weight: 500;
            transition: var(--transition);
        }
        
        .join-btn:hover {
            background-color: #1d4ed8;
            transform: translateY(-2px);
        }
        
        .joined-btn {
            background-color: var(--primary-light);
            color: var(--primary);
            border: none;
            border-radius: 6px;
            padding: 6px 16px;
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        .layout-tabs .nav-link {
            color: var(--secondary);
            border: none;
            border-bottom: 2px solid transparent;
            border-radius: 0;
            padding: 0.5rem 1rem;
            font-weight: 500;
        }
        
        .layout-tabs .nav-link.active {
            color: var(--primary);
            border-bottom: 2px solid var(--primary);
            background: transparent;
        }
        
        /* 列表布局样式 */
        .list-layout .event-card {
            flex-direction: row;
            height: auto;
        }
        
        .list-layout .event-image-container {
            flex: 0 0 200px;
        }
        
        @media (max-width: 768px) {
            .list-layout .event-card {
                flex-direction: column;
            }
            
            .list-layout .event-image-container {
                flex: none;
                height: 180px;
            }
        }
    </style>
</head>
<body>
    <div class="container mt-5 mb-10">
        <h2 class="text-primary fw-bold mb-2">推荐活动</h2>
        <p class="text-secondary mb-6">发现身边有趣的活动，结识志同道合的朋友</p>
        
        <!-- 布局切换 -->
        <ul class="nav layout-tabs mb-6" id="layoutTabs" role="tablist">
            <li class="nav-item" role="presentation">
                <button class="nav-link active" id="card-layout-tab" data-bs-toggle="tab" 
                        data-bs-target="#card-layout" type="button" role="tab" 
                        aria-controls="card-layout" aria-selected="true">
                    <i class="fas fa-th-large me-2"></i>卡片布局
                </button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="list-layout-tab" data-bs-toggle="tab" 
                        data-bs-target="#list-layout" type="button" role="tab" 
                        aria-controls="list-layout" aria-selected="false">
                    <i class="fas fa-list me-2"></i>列表布局
                </button>
            </li>
        </ul>
        
        <!-- 活动内容区域 -->
        <div class="tab-content" id="layoutTabsContent">
            <!-- 卡片布局 -->
            <div class="tab-pane fade show active" id="card-layout" role="tabpanel" aria-labelledby="card-layout-tab">
                <div class="row gap-4">
                    <!-- 无图活动 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="event-card">
                            <div class="event-info">
                                <div class="d-flex justify-content-between items-start mb-2">
                                    <span class="event-tag">线上</span>
                                    <span class="event-status status-new">新活动</span>
                                </div>
                                
                                <h3 class="event-title">2023前端开发者线上交流会</h3>
                                
                                <div class="event-meta">
                                    <div><i class="far fa-calendar-alt"></i> 10月15日</div>
                                    <div><i class="far fa-clock"></i> 19:30-21:00</div>
                                </div>
                                
                                <p class="event-description">
                                    本次线上交流会将探讨前端开发的最新趋势和技术实践，包括React Server Components、CSS新特性和性能优化技巧。适合各阶段前端开发者参与。
                                </p>
                                
                                <div class="event-organizer">
                                    <img src="https://picsum.photos/200/200?random=1" alt="组织者头像" class="organizer-avatar">
                                    <span class="organizer-name">前端技术社区</span>
                                </div>
                                
                                <div class="event-actions">
                                    <div class="participants">
                                        <div class="participant-avatars">
                                            <img src="https://picsum.photos/200/200?random=10" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=11" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=12" alt="参与者头像">
                                        </div>
                                        <span class="ms-2">+128人参加</span>
                                    </div>
                                    <button class="join-btn">
                                        <i class="fas fa-user-plus me-1"></i> 参加
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 单图活动 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="event-card">
                            <div class="event-image-container" style="height: 180px;">
                                <img src="https://picsum.photos/600/400?random=20" alt="城市马拉松活动" class="event-image">
                                <span class="event-tag">运动</span>
                                <span class="event-status status-hot">热门</span>
                            </div>
                            
                            <div class="event-info">
                                <h3 class="event-title">城市半程马拉松公益跑</h3>
                                
                                <div class="event-meta">
                                    <div><i class="far fa-calendar-alt"></i> 11月5日</div>
                                    <div><i class="fas fa-map-marker-alt"></i> 中央公园</div>
                                </div>
                                
                                <p class="event-description">
                                    年度城市半程马拉松，全程21公里， proceeds将捐赠给儿童教育事业。设有专业组和休闲组，欢迎各年龄段跑步爱好者参与。
                                </p>
                                
                                <div class="event-organizer">
                                    <img src="https://picsum.photos/200/200?random=2" alt="组织者头像" class="organizer-avatar">
                                    <span class="organizer-name">城市运动协会</span>
                                </div>
                                
                                <div class="event-actions">
                                    <div class="participants">
                                        <div class="participant-avatars">
                                            <img src="https://picsum.photos/200/200?random=13" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=14" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=15" alt="参与者头像">
                                        </div>
                                        <span class="ms-2">+532人参加</span>
                                    </div>
                                    <button class="join-btn">
                                        <i class="fas fa-user-plus me-1"></i> 参加
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 双图活动 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="event-card">
                            <div class="event-image-container" style="height: 180px;">
                                <div class="multi-image-grid multi-image-2 h-100">
                                    <img src="https://picsum.photos/300/300?random=21" alt="艺术展作品" class="event-image">
                                    <img src="https://picsum.photos/300/300?random=22" alt="艺术展现场" class="event-image">
                                </div>
                                <span class="event-tag">艺术</span>
                            </div>
                            
                            <div class="event-info">
                                <h3 class="event-title">现代艺术装置展"城市脉搏"</h3>
                                
                                <div class="event-meta">
                                    <div><i class="far fa-calendar-alt"></i> 10月10-30日</div>
                                    <div><i class="fas fa-map-marker-alt"></i> 当代艺术馆</div>
                                </div>
                                
                                <p class="event-description">
                                    汇集国内外20位艺术家的大型装置艺术展，探索城市与人类的关系。展览包含互动装置和沉浸式体验区。
                                </p>
                                
                                <div class="event-organizer">
                                    <img src="https://picsum.photos/200/200?random=3" alt="组织者头像" class="organizer-avatar">
                                    <span class="organizer-name">现代艺术联盟</span>
                                </div>
                                
                                <div class="event-actions">
                                    <div class="participants">
                                        <div class="participant-avatars">
                                            <img src="https://picsum.photos/200/200?random=16" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=17" alt="参与者头像">
                                        </div>
                                        <span class="ms-2">+318人参加</span>
                                    </div>
                                    <button class="joined-btn">
                                        <i class="fas fa-check me-1"></i> 已参加
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 三图活动 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="event-card">
                            <div class="event-image-container" style="height: 180px;">
                                <div class="multi-image-grid multi-image-3 h-100">
                                    <img src="https://picsum.photos/300/200?random=23" alt="美食节现场" class="event-image">
                                    <img src="https://picsum.photos/300/200?random=24" alt="特色美食" class="event-image">
                                    <img src="https://picsum.photos/604/200?random=25" alt="烹饪展示" class="event-image">
                                </div>
                                <span class="event-tag">美食</span>
                                <span class="event-status status-soon">即将开始</span>
                            </div>
                            
                            <div class="event-info">
                                <h3 class="event-title">国际美食文化节</h3>
                                
                                <div class="event-meta">
                                    <div><i class="far fa-calendar-alt"></i> 10月28-30日</div>
                                    <div><i class="fas fa-map-marker-alt"></i> 文化广场</div>
                                </div>
                                
                                <p class="event-description">
                                    汇聚全球20多个国家的特色美食，现场有厨师表演、美食制作教学和试吃活动。还有各国文化展示和民俗表演。
                                </p>
                                
                                <div class="event-organizer">
                                    <img src="https://picsum.photos/200/200?random=4" alt="组织者头像" class="organizer-avatar">
                                    <span class="organizer-name">国际文化交流中心</span>
                                </div>
                                
                                <div class="event-actions">
                                    <div class="participants">
                                        <div class="participant-avatars">
                                            <img src="https://picsum.photos/200/200?random=18" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=19" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=20" alt="参与者头像">
                                        </div>
                                        <span class="ms-2">+786人参加</span>
                                    </div>
                                    <button class="join-btn">
                                        <i class="fas fa-user-plus me-1"></i> 参加
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 四图活动 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="event-card">
                            <div class="event-image-container" style="height: 180px;">
                                <div class="multi-image-grid multi-image-4 h-100">
                                    <img src="https://picsum.photos/300/300?random=26" alt="志愿者活动-环保" class="event-image">
                                    <img src="https://picsum.photos/300/300?random=27" alt="志愿者活动-捐赠" class="event-image">
                                    <img src="https://picsum.photos/300/300?random=28" alt="志愿者活动-教学" class="event-image">
                                    <img src="https://picsum.photos/300/300?random=29" alt="志愿者活动-团队" class="event-image">
                                </div>
                                <span class="event-tag">公益</span>
                            </div>
                            
                            <div class="event-info">
                                <h3 class="event-title">"爱心传递"社区志愿者日</h3>
                                
                                <div class="event-meta">
                                    <div><i class="far fa-calendar-alt"></i> 11月12日</div>
                                    <div><i class="fas fa-map-marker-alt"></i> 阳光社区</div>
                                </div>
                                
                                <p class="event-description">
                                    社区志愿者日活动，包括老人关爱、儿童辅导、环境清洁和旧物捐赠等项目。欢迎有爱心的朋友加入我们，一起为社区贡献力量。
                                </p>
                                
                                <div class="event-organizer">
                                    <img src="https://picsum.photos/200/200?random=5" alt="组织者头像" class="organizer-avatar">
                                    <span class="organizer-name">爱心志愿者协会</span>
                                </div>
                                
                                <div class="event-actions">
                                    <div class="participants">
                                        <div class="participant-avatars">
                                            <img src="https://picsum.photos/200/200?random=21" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=22" alt="参与者头像">
                                        </div>
                                        <span class="ms-2">+94人参加</span>
                                    </div>
                                    <button class="join-btn">
                                        <i class="fas fa-user-plus me-1"></i> 参加
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 单图活动（已参加） -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="event-card">
                            <div class="event-image-container" style="height: 180px;">
                                <img src="https://picsum.photos/600/400?random=30" alt="音乐节现场" class="event-image">
                                <span class="event-tag">音乐</span>
                                <span class="event-status status-hot">热门</span>
                            </div>
                            
                            <div class="event-info">
                                <h3 class="event-title">城市爵士音乐节</h3>
                                
                                <div class="event-meta">
                                    <div><i class="far fa-calendar-alt"></i> 12月2-3日</div>
                                    <div><i class="fas fa-map-marker-alt"></i> 滨江公园</div>
                                </div>
                                
                                <p class="event-description">
                                    为期两天的爵士音乐节，将有15支国内外知名爵士乐队登台演出。现场设有美食区和文创市集，适合全家参与。
                                </p>
                                
                                <div class="event-organizer">
                                    <img src="https://picsum.photos/200/200?random=6" alt="组织者头像" class="organizer-avatar">
                                    <span class="organizer-name">城市音乐节组委会</span>
                                </div>
                                
                                <div class="event-actions">
                                    <div class="participants">
                                        <div class="participant-avatars">
                                            <img src="https://picsum.photos/200/200?random=23" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=24" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=25" alt="参与者头像">
                                            <img src="https://picsum.photos/200/200?random=26" alt="当前用户头像">
                                        </div>
                                        <span class="ms-2">+1253人参加</span>
                                    </div>
                                    <button class="joined-btn">
                                        <i class="fas fa-check me-1"></i> 已参加
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 列表布局 -->
            <div class="tab-pane fade" id="list-layout" role="tabpanel" aria-labelledby="list-layout-tab">
                <div class="list-layout space-y-4">
                    <!-- 无图活动（列表） -->
                    <div class="event-card">
                        <div class="event-info">
                            <div class="d-flex justify-content-between items-start mb-2">
                                <span class="event-tag">线上</span>
                                <span class="event-status status-new">新活动</span>
                            </div>
                            
                            <h3 class="event-title">2023前端开发者线上交流会</h3>
                            
                            <div class="event-meta">
                                <div><i class="far fa-calendar-alt"></i> 10月15日</div>
                                <div><i class="far fa-clock"></i> 19:30-21:00</div>
                                <div class="event-organizer d-inline-flex">
                                    <img src="https://picsum.photos/200/200?random=1" alt="组织者头像" class="organizer-avatar" style="width: 24px; height: 24px;">
                                    <span class="organizer-name">前端技术社区</span>
                                </div>
                            </div>
                            
                            <p class="event-description">
                                本次线上交流会将探讨前端开发的最新趋势和技术实践，包括React Server Components、CSS新特性和性能优化技巧。适合各阶段前端开发者参与。
                            </p>
                            
                            <div class="event-actions">
                                <div class="participants">
                                    <div class="participant-avatars">
                                        <img src="https://picsum.photos/200/200?random=10" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=11" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=12" alt="参与者头像">
                                    </div>
                                    <span class="ms-2">+128人参加</span>
                                </div>
                                <button class="join-btn">
                                    <i class="fas fa-user-plus me-1"></i> 参加
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 单图活动（列表） -->
                    <div class="event-card">
                        <div class="event-image-container">
                            <img src="https://picsum.photos/600/400?random=20" alt="城市马拉松活动" class="event-image">
                            <span class="event-tag">运动</span>
                            <span class="event-status status-hot">热门</span>
                        </div>
                        
                        <div class="event-info">
                            <h3 class="event-title">城市半程马拉松公益跑</h3>
                            
                            <div class="event-meta">
                                <div><i class="far fa-calendar-alt"></i> 11月5日</div>
                                <div><i class="fas fa-map-marker-alt"></i> 中央公园</div>
                                <div class="event-organizer d-inline-flex">
                                    <img src="https://picsum.photos/200/200?random=2" alt="组织者头像" class="organizer-avatar" style="width: 24px; height: 24px;">
                                    <span class="organizer-name">城市运动协会</span>
                                </div>
                            </div>
                            
                            <p class="event-description">
                                年度城市半程马拉松，全程21公里， proceeds将捐赠给儿童教育事业。设有专业组和休闲组，欢迎各年龄段跑步爱好者参与。
                            </p>
                            
                            <div class="event-actions">
                                <div class="participants">
                                    <div class="participant-avatars">
                                        <img src="https://picsum.photos/200/200?random=13" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=14" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=15" alt="参与者头像">
                                    </div>
                                    <span class="ms-2">+532人参加</span>
                                </div>
                                <button class="join-btn">
                                    <i class="fas fa-user-plus me-1"></i> 参加
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 三图活动（列表） -->
                    <div class="event-card">
                        <div class="event-image-container">
                            <div class="multi-image-grid multi-image-3 h-100">
                                <img src="https://picsum.photos/300/200?random=23" alt="美食节现场" class="event-image">
                                <img src="https://picsum.photos/300/200?random=24" alt="特色美食" class="event-image">
                                <img src="https://picsum.photos/604/200?random=25" alt="烹饪展示" class="event-image">
                            </div>
                            <span class="event-tag">美食</span>
                            <span class="event-status status-soon">即将开始</span>
                        </div>
                        
                        <div class="event-info">
                            <h3 class="event-title">国际美食文化节</h3>
                            
                            <div class="event-meta">
                                <div><i class="far fa-calendar-alt"></i> 10月28-30日</div>
                                <div><i class="fas fa-map-marker-alt"></i> 文化广场</div>
                                <div class="event-organizer d-inline-flex">
                                    <img src="https://picsum.photos/200/200?random=4" alt="组织者头像" class="organizer-avatar" style="width: 24px; height: 24px;">
                                    <span class="organizer-name">国际文化交流中心</span>
                                </div>
                            </div>
                            
                            <p class="event-description">
                                汇聚全球20多个国家的特色美食，现场有厨师表演、美食制作教学和试吃活动。还有各国文化展示和民俗表演。
                            </p>
                            
                            <div class="event-actions">
                                <div class="participants">
                                    <div class="participant-avatars">
                                        <img src="https://picsum.photos/200/200?random=18" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=19" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=20" alt="参与者头像">
                                    </div>
                                    <span class="ms-2">+786人参加</span>
                                </div>
                                <button class="join-btn">
                                    <i class="fas fa-user-plus me-1"></i> 参加
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 四图活动（列表） -->
                    <div class="event-card">
                        <div class="event-image-container">
                            <div class="multi-image-grid multi-image-4 h-100">
                                <img src="https://picsum.photos/300/300?random=26" alt="志愿者活动-环保" class="event-image">
                                <img src="https://picsum.photos/300/300?random=27" alt="志愿者活动-捐赠" class="event-image">
                                <img src="https://picsum.photos/300/300?random=28" alt="志愿者活动-教学" class="event-image">
                                <img src="https://picsum.photos/300/300?random=29" alt="志愿者活动-团队" class="event-image">
                            </div>
                            <span class="event-tag">公益</span>
                        </div>
                        
                        <div class="event-info">
                            <h3 class="event-title">"爱心传递"社区志愿者日</h3>
                            
                            <div class="event-meta">
                                <div><i class="far fa-calendar-alt"></i> 11月12日</div>
                                <div><i class="fas fa-map-marker-alt"></i> 阳光社区</div>
                                <div class="event-organizer d-inline-flex">
                                    <img src="https://picsum.photos/200/200?random=5" alt="组织者头像" class="organizer-avatar" style="width: 24px; height: 24px;">
                                    <span class="organizer-name">爱心志愿者协会</span>
                                </div>
                            </div>
                            
                            <p class="event-description">
                                社区志愿者日活动，包括老人关爱、儿童辅导、环境清洁和旧物捐赠等项目。欢迎有爱心的朋友加入我们，一起为社区贡献力量。
                            </p>
                            
                            <div class="event-actions">
                                <div class="participants">
                                    <div class="participant-avatars">
                                        <img src="https://picsum.photos/200/200?random=21" alt="参与者头像">
                                        <img src="https://picsum.photos/200/200?random=22" alt="参与者头像">
                                    </div>
                                    <span class="ms-2">+94人参加</span>
                                </div>
                                <button class="join-btn">
                                    <i class="fas fa-user-plus me-1"></i> 参加
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="text-center mt-8">
            <button class="btn btn-outline-primary px-6 py-2 rounded-full hover:bg-primary hover:text-white transition-all">
                查看更多活动 <i class="fas fa-chevron-down ms-2"></i>
            </button>
        </div>
    </div>

    <script>
        // 初始化布局切换
        const layoutTabs = new bootstrap.Tab('#layoutTabs');
        
        // 参加/取消参加功能
        document.querySelectorAll('.join-btn, .joined-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const participantsCountEl = this.closest('.event-actions').querySelector('.participants span');
                let participantsCount = parseInt(participantsCountEl.textContent.match(/\+(\d+)/)[1]);
                
                if (this.classList.contains('join-btn')) {
                    // 切换为已参加状态
                    this.classList.remove('join-btn');
                    this.classList.add('joined-btn');
                    this.innerHTML = '<i class="fas fa-check me-1"></i> 已参加';
                    
                    // 增加参与者数量
                    participantsCountEl.textContent = `+${participantsCount + 1}人参加`;
                    
                    // 添加当前用户头像到参与者列表
                    const avatarContainer = this.closest('.event-actions').querySelector('.participant-avatars');
                    const newAvatar = document.createElement('img');
                    newAvatar.src = `https://picsum.photos/200/200?random=${Math.floor(Math.random() * 100)}`;
                    newAvatar.alt = "当前用户头像";
                    newAvatar.style.width = "24px";
                    newAvatar.style.height = "24px";
                    newAvatar.style.borderRadius = "50%";
                    newAvatar.style.border = "2px solid white";
                    newAvatar.style.marginLeft = "-8px";
                    avatarContainer.appendChild(newAvatar);
                } else {
                    // 切换为未参加状态
                    this.classList.remove('joined-btn');
                    this.classList.add('join-btn');
                    this.innerHTML = '<i class="fas fa-user-plus me-1"></i> 参加';
                    
                    // 减少参与者数量
                    participantsCountEl.textContent = `+${participantsCount - 1}人参加`;
                    
                    // 移除当前用户头像（假设最后一个是当前用户）
                    const avatarContainer = this.closest('.event-actions').querySelector('.participant-avatars');
                    if (avatarContainer.lastChild) {
                        avatarContainer.removeChild(avatarContainer.lastChild);
                    }
                }
            });
        });
        
        // 加载更多功能
        document.querySelector('.btn-outline-primary').addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin me-2"></i> 加载中...';
            
            // 模拟加载延迟
            setTimeout(() => {
                this.innerHTML = '查看更多活动 <i class="fas fa-chevron-down ms-2"></i>';
                // 实际应用中这里会添加新的活动内容
            }, 1500);
        });
    </script>
</body>
</html>
    
